<?php
require_once "WXconfig.php";
header("Content-type: text/html; charset=UTF-8");

$aa = $_GET['traceno'];
$bb = $_GET['refno'];
    


function doCurlPostRequest2($traceno,$refno,$timeout = 5){
	$urls=Configs::URLQRCODEQUERY;
 $Md5=Configs::SIGNATURE;
 $merchnos=Configs::MERCHNO;
 $post_data = array(
    'merchno' => $merchnos,
    'traceno' => $traceno, 
    'refno' => $refno,
   
);
ksort($post_data);
$a='';
foreach($post_data as $x=>$x_value)
{
		$a=$a.$x."=".iconv('UTF-8', 'GB2312',$x_value)."&";
}
$b=md5($a.$Md5);
$c=$a.'signature'.'='.$b;
 if($urls == '' || $traceno == ''|| $refno == ''  || $timeout <=0){
 return false;
 }
 $con = curl_init((string)$urls);
 curl_setopt($con, CURLOPT_HEADER, false);
 curl_setopt($con, CURLOPT_POSTFIELDS, $c);
 curl_setopt($con, CURLOPT_POST,true);
 curl_setopt($con, CURLOPT_RETURNTRANSFER,true);
 curl_setopt($con, CURLOPT_TIMEOUT,(int)$timeout);
 return curl_exec($con); 
}
echo iconv('GB2312', 'UTF-8', doCurlPostRequest2($aa, $bb));

?>